-
-
Notifications
You must be signed in to change notification settings - Fork 21
Beginning touch support #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: arduino
Are you sure you want to change the base?
Conversation
Wondering, an alternative implementation for this would be instead of having a handler here, that
|
Talking to self (and maybe others) In certain ways, I think the idea of setting a callback function like I mentioned in the previous comment, might make sense, but one thing (of many) I don't understand, is how to do that in a safe way. That is Suppose, I setup and run our example Touch Paint sketch, which registers it's callback. Then suppose I decide to run some simple sketch like blink. After Blink loads, my guess is that the callback pointer would be set to wherever it was in the previous sketch, and if the user touches the screen, we will Or is there some method we call at sketch startup that can clear the callback(s)... EDIT: One option, is maybe add the InitVariant for the GIGA, and set it to NULL at that point... |
13960d6
to
a046e8d
Compare
89d3fd5
to
7abe8c3
Compare
Currently the config option: CONFIG_INPUT_GT911_MAX_TOUCH_POINTS is not defined for the Giga display shield and defaults to 1. The valid range is 1-5, I have done most of my own testing using 3 with the ArduinoGiga-zephyr I have a PR against the ArduinoCore-zephyr project which allows me to define a callback in the Arduino system: arduino/ArduinoCore-zephyr#134 And a version of the Arduino touch library with some support, the fork/branch https://github.com/KurtE/Arduino_GigaDisplayTouch/tree/zephyr And an example sketch that does touch paint. arduino/ArduinoCore-zephyr#92 (comment) Note: my version of the Arduino touch library has no support for gestures Signed-off-by: Kurt Eckhardt <[email protected]>
Currently the config option: CONFIG_INPUT_GT911_MAX_TOUCH_POINTS is not defined for the Giga display shield and defaults to 1. The valid range is 1-5, I have done most of my own testing using 3 with the ArduinoGiga-zephyr I have a PR against the ArduinoCore-zephyr project which allows me to define a callback in the Arduino system: arduino/ArduinoCore-zephyr#134 And a version of the Arduino touch library with some support, the fork/branch https://github.com/KurtE/Arduino_GigaDisplayTouch/tree/zephyr And an example sketch that does touch paint. arduino/ArduinoCore-zephyr#92 (comment) Note: my version of the Arduino touch library has no support for gestures Signed-off-by: Kurt Eckhardt <[email protected]>
7abe8c3
to
135693d
Compare
@ALL - I cleaned up some of the code in this PR to cleanup which CONFIG_ the code is under for touch. Instead of VIDEO (which is for camera) it uses CONFIG_INPUT_GT911_INTERRUPT Warning these fixes also included fixes that allow the GC2145 camera to work on Portenta H7. Let me know if there is anything you think that should be changed. |
…er in fixups. Added the ability to register a callback function to be called by the zephyr input system. This new code is only there if it is a GIGA and CONFIG_INPUT_GT911_INTERRUPT is defined. This includes adding a callback function that is linked in to the zephyr build, and export a function to call to allow us to register our own. Added an init variant to GIGA that if the touch interrupt is enabled, then it will clear out the old user defined callback if any. This version also added in the changes to fixups that allow a camera to work on Portenta H7. Needed to have it do the same as GIGA to start the PWM if INPUT is configured in. And updated the portentas remote_endpoint define to be using the same format as used in the giga overlay Also changed to STM32_DMA_FIFO_1-4, like the GIGA currently has Update arduino_portenta_h7_stm32h747xx_m7.overlay
135693d
to
6e05523
Compare
Add a callback function for the touch device
within the fixups for the GIGA. This callback
simply remembers the last touch that happened and
sets a semaphore.
There is also a function added to retrieve this data.
Needed to add the callback function into the exports file.
EDIT: As I mentioned in
#92
This is maybe not a complete setup yet. Currently the zephyr touch device is configured for only one touch
Where it believe is supposed to support up to 5. Also with it only doing one touch, it does not support
gestures. I will integrate our WIP touch code into the Arduino_GIGATouch library such that it is all
available for us or others to fill this in.